#!/usr/bin/python
# -*- coding: gbk -*-

import sys

from WConio import *

__all__ = ["cprint",'settitle','textbackground','textcolor','BLACK','BLUE','GREEN','CYAN','RED','MAGENTA','BROWN','LIGHTGRAY','DARKGRAY','LIGHTBLUE','LIGHTGREEN','LIGHTCYAN','LIGHTRED','LIGHTMAGENTA','YELLOW','WHITE','clrscr']

def cprint(*args, **kwd): # 2.4, 2.5, define our own Print function
    fout = kwd.get("file", sys.stdout)
    w = fout.write
    if args:
        color = kwd.get('color',None)
        if color:
            textcolor(color)

        w(str(args[0]))
        sep = kwd.get("sep", " ")

        for a in args[1:]:
            w(sep)
            w(str(a))
        w(kwd.get("end", "\n"))
        
        if color:
            textcolor(LIGHTGRAY)

def main():
    for c in range(16):
        cprint('hello,world: ',__all__[c+4],color=c)

if __name__ == "__main__":
    main()
